function ParameterColor(data, bg)
%Plots the graph with a heatmap colored according to the data vector
%provided

dataSize = max(size(data));
%cmap = jet(dataSize+1);
cmap = hot(dataSize+1);
indices = fix((data-min(data))./(max(data)-min(data)).*dataSize)+1;

try
    for i=1:dataSize
        %set(bg.nodes(i),'Color',cmap(62-indices(i),:));
        set(bg.nodes(i),'Color',cmap(indices(i),:));
        if (indices(i) < dataSize/6)
            set(bg.nodes(i),'TextColor',[1 1 1]);
        end
    end
    view(bg)
catch ex
    warning(ex.message)
end